package com.xiaoshuidi.cloud.module.rooms.api.roomstate;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.rooms.api.roomstate.dto.RoomTenantsInfoDTO;
import com.xiaoshuidi.cloud.module.rooms.api.roomstate.dto.UpdateRoomStateReqDTO;
import com.xiaoshuidi.cloud.module.rooms.api.roomstate.vo.GetCurrentRecordRespVO;
import com.xiaoshuidi.cloud.module.rooms.api.roomstate.vo.UpdateRoomTenantReqVO;
import com.xiaoshuidi.cloud.module.rooms.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

/**
 * @author hans.zhang
 */

@FeignClient(name = ApiConstants.SERVERNAME)
@Tag(name = "RPC接口 - 房态相关接口")
public interface RoomStateRecordApi {

    String PREFIX = ApiConstants.PREFIX + "/roomstaterecord";

    @Operation(summary = "获取当前房态")
    @Parameters({
            @Parameter(name = "roomHouseId", description = "房源id")
    })
    @GetMapping( PREFIX + "/get-current-record")
    public CommonResult<GetCurrentRecordRespVO> getCurrentRecord(@RequestParam("roomHouseId") Long roomHouseId);

    @Operation(summary = "根据合同修改房态")
    @PutMapping( PREFIX + "/update-room-state-by-contract")
    public CommonResult<Boolean> updateRoomStateByContract(@RequestBody UpdateRoomStateReqDTO updateRoomStateReqDTO);

    @Operation(summary = "根据合同修改房态批量")
    @PutMapping( PREFIX + "/update-rooms-state-by-contract")
    public CommonResult<Boolean> updateRoomStateByContract(@RequestBody List<UpdateRoomStateReqDTO> updateRoomStateReqDTOS);

    @Operation(summary = "修改租住人/同住人信息")
    @PutMapping( PREFIX + "/update-room-tenant")
    public CommonResult<Boolean> updateRoomTenant(@RequestBody @Valid UpdateRoomTenantReqVO updateRoomTenantReqVO);


}
